package org.zebias.springcloudeurekaclientsearch.controller;

import org.springframework.web.bind.annotation.*;
import org.zebias.springcloudeurekaclientsearch.entity.Customer;

/**
 * @ClassName SearchController
 * @Description 搜索控制类
 * @Author zebias
 * @Date 2020/12/31 14:48
 * @Version 1.0
 **/
@RestController
public class SearchController {

    @GetMapping("/search")
    public String search() {
//        return "Ribbon调用成功";
        return "Fegin调用成功";
    }

    @GetMapping("/search/{id}")
    public Customer findById(@PathVariable Integer id){
        return new Customer(id,"张三",23);
    }

    @GetMapping("getCustomer")
    public Customer getCustom(@RequestParam Integer id, @RequestParam String name){
        return new Customer(id,name,21);
    }

    @PostMapping("save")
    public Customer save(@RequestBody Customer customer){
        return customer;
    }

}
